import request from "@/utils/request.ts";
import type { ProductResponseData } from './type'

enum API{
    PRODUCT_LIST_URL = '/api/products'
}

// 获取商品列表
export const reqProductList = (params: any) =>
    request.get<any, ProductResponseData>(API.PRODUCT_LIST_URL, { params })
// 新增商品
export const reqAddProduct = (data: any) =>
    request.post<any, any>(API.PRODUCT_LIST_URL, data)
// 删除商品
export const reqDeleteProduct = (id: number) =>
    request.delete<any, any>(`${API.PRODUCT_LIST_URL}/${id}`)
